﻿<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/demo.css">
<style type="text/css">
.box{
	width: 20px;
	height: 20px;
	padding: 2px;
	border:1px solid #ccc;
	border-radius: 2px;
}
</style>

</head>
<body>

<div class="container">
	<div class="row">
		<div class="col-md-12" style="padding:2em 0;">
			<p>点击 <i class="fa fa-pencil box"></i> 按钮可以对表格进行编辑，点击 <i class="fa fa-trash-o box"></i>按钮可以将该表格行删除。</p>
			<div class="table-responsive">
				<table class="table table-bordered table-striped" id="mytable">
					<thead>
					  <tr>
						<td>用户名</td>
						<td>等级</td>
						<td>会员到期时间</td>
					  </tr>
					</thead>
					<tbody>
					  <tr>
						<td>张三</td>
						<td>2</td>
						<td>20200614</td>
					  </tr>
					  <tr>
						<td>李四</td>
						<td>3</td>
						<td>20200615</td>
					  </tr>
					  <tr>
						<td>王五</td>
						<td>4</td>
						<td>20200617</td>
					  </tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="col-md-12"  style="padding-bottom:2em;">
			<button class="btn btn-info" id="add"><i class="fa fa-plus"></i> 添加新的表格行</button>
		</div>
	</div>
</div>

<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/bootstable.js"></script>
<script type="text/javascript">
	$('#mytable').SetEditable({
		$addButton: $('#add')
	});
</script>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">

</div>
</body>
</html>